load("//tools/lint:lint.bzl", "add_lint_tests")
load("//tools/skylark:drake_py.bzl", "drake_py_unittest")

config_setting(
    name = "enabled",
    flag_values = {"//tools/flags:with_ipopt": "True"},
)

# Drake must redistribute any code changes, per Ipopts's EPL-2.0 license.
# Here we'll glob all of the patch files from their conventional home.
#
# The glob might be empty if we don't have any patches at the moment,
# but we'll keep the boilerplate here as a fail-safe.
filegroup(
    name = "patches",
    srcs = glob(
        ["patches/**"],
        allow_empty = True,
    ),
    visibility = ["//visibility:public"],
)

drake_py_unittest(
    name = "lint_test",
    data = [
        ":package.BUILD.bazel",
        "@ipopt_internal//:src/Makefile.am",
    ],
    tags = ["lint"],
    deps = [
        "@rules_python//python/runfiles",
    ],
)

add_lint_tests()
